<?php
/**
 * Created by PhpStorm.
 * User: Yieong
 * Date: 14/11/19
 * Time: 下午8:12
 */

class ModCodeUseLog extends Model {

    protected $table = 'code_use_log';

    // 表名
    public function tableName(){
        return $this->table;
    }

    public static function model($className=__CLASS__){
        return parent::model($className);
    }

    public function getDbConnection(){
        return Yii::app()->dbOss;
    }

    public function selectPoolAccount($pool_id,$account){
    	$sql = "SELECT * FROM {$this->table} where pool_id = {$pool_id} and use_account = '{$account}' ORDER BY use_time DESC limit 1";
    	 
    	$result = $this->getDbConnection()->getAll($sql, $args);
    	return $result;
    }
    

    

    
} 